#-*-coding: utf8 -*-
from django.conf import settings
from django.http import HttpResponse
from django.shortcuts import render
from django.views.generic.base import TemplateView
from django.utils.translation import gettext as _, activate

from website.models import Article


class IndexView(TemplateView):
    template_name = 'index.html'

    def get_context_data(self, **kwargs):
        context = super(IndexView, self).get_context_data(**kwargs)
        context['articles'] = Article.objects.filter()[:10]
        return context
